<%@Page Language="VB"%>
<%@Import Namespace="System.Data" %>
<%@Import Namespace="System.Data.SqlClient" %>
<html><head>
<title>
Repeater Control</title>
</head>
<body>
<span class="heading">
	Repeater and ADO.NET Objects
</span>
<hr width="350" align="left"/>
<div id="outError" runat="server">&nbsp;</div>
<form runat=server>
<b>&lt;ASP:Repeater&gt;</b> control:<br />
<select name="User">
   <option value="0">None</option>
  <asp:repeater ID="clRepeater" runat="server"> 
	<itemtemplate> 
	 <option value="<%#DataBinder.Eval(Container.DataItem,"UserID") %>"> 
	 <%# DataBinder.Eval(Container.DataItem,"UserName") %>
	  </option>
	</itemtemplate>
	</asp:repeater>
</select>
<br />
<b>&lt;ASP:Repeater&gt;</b> control:<br />
<ASP:Repeater id="MyRepeater" runat="server">
  <ItemTemplate>
     <%#DataBinder.Eval(Container.DataItem,"UserID") %>
     <%# DataBinder.Eval(Container.DataItem,"UserName") %><br>
  </ItemTemplate>
</ASP:Repeater><br />

<b>&lt;ASP:Repeater&gt;</b> control to make Checkbox:<br />
<ASP:Repeater id="MychkRepeater" runat="server">
  <ItemTemplate>
     <input type=checkbox value=<%#DataBinder.Eval(Container.DataItem,"UserID") %>>
     <%# DataBinder.Eval(Container.DataItem,"UserName") %><br>
  </ItemTemplate>
</ASP:Repeater><br />

<b>&lt;ASP:Repeater&gt;</b> control:<br />
<ASP:Repeater id="MyArrRepeater" runat="server">
  <ItemTemplate>
    <%# Container.DataItem %>
  </ItemTemplate>
</ASP:Repeater><br />



</form>

<script language="vb" runat="server">
Sub Page_Load(ByVal sender As Object, _
ByVal e As EventArgs)      
   Dim myDataSet As New DataSet()
   Try
      Dim strConn As String
      Dim strSQL As String
      strConn= _
      ConfigurationSettings.appSettings("conn")
      Dim myConn As New SqlConnection(strConn)      
      strSQL = "SELECT * From "
      strSQL +=" tblUsers"
      Dim myDataAdapter As New _
	SqlDataAdapter(strSQL, myConn)
      myDataAdapter.Fill(myDataSet,  _
	strSQL)     
   Catch objError As Exception
      	outError.innerHTML = _
	"<b>* Error while " & _
	"accessing data</b>.<br />" _
          	& objError.Message & "<br />" & _
	objError.Source
      Exit Sub  
   End Try        
   clRepeater.DataSource = myDataSet
   myRepeater.DataSource = myDataSet  
   mychkRepeater.DataSource = myDataSet  
   Dim arrValues As New ArrayList(5)
   arrValues.Add("Microsoft")
   arrValues.Add("Sun")
   arrValues.Add("IBM")
   arrValues.Add("Compaq")
   arrValues.Add("Oracle")

   MyArrRepeater.DataSource = arrValues

   Page.DataBind()
End Sub
</script>
</body>
</html>
  